package main.java.observer.jdkDemo;

import java.util.Observable;
import java.util.Observer;

/**
 * 发布者
 */
public class Thief extends Observable {
    private String name;

    public Thief(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void steal(){
        System.out.println("小偷出来了");
        super.setChanged();
        super.notifyObservers();

    }
}
